<template>
	<view :style="themeColor">
		<view class="page">
			<view
				class="flex flex-direction flex-wrap align-stretch justify-center benben-position-layout flex feedBack_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-stretch justify-between feedBack_fd0_0'>
					<view class='flex flex-wrap align-center feedBack_fd0_0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">
						<text class='fu-iconfont2  feedBack_fd0_0_c0_c0'>&#xe794;</text>
					</view>
					<view class='flex flex-wrap align-center'>
						<text class='feedBack_fd0_0_c1_c0'>意见反馈</text>
					</view>
					<view class='flex align-center justify-end feedBack_fd0_0_c2'>
					</view>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="loading_css" v-if="isShow">
				<u-loading size="36" color="#F35D2A"></u-loading>
				<view>加载中</view>
			</view>
			<block v-else>
				<!---意见反馈表单flex布局开始-->
				<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout feedBack_flex_1">
					<view class='flex flex-direction align-stretch feedBack_fd1_0'>
						<view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_0_c0'>
							<view class='flex flex-wrap align-center feedBack_fd1_0_c0_c0'>
								<view class='feedBack_fd1_0_c0_c0_c0'>反馈类型</view>
							</view>
							<view class='flex flex-direction flex-wrap align-stretch'>
								<benben-select-diy ref="showSelectPopup1698220374271"
									class-name='flex flex-wrap align-center flex' :items.sync="dataList"
									v-model="changeId" default-type="id" default-label="title" :allow-cancel='false'
									type="radio" :disabled='false'>
									<template v-for='(item,key0) in dataList'>
										<view v-if="item.isSelected"
											class='flex align-center justify-center flex feedBack_fd1_0_c0_c1_c0_c0'
											:key="key0" @tap="$refs.showSelectPopup1698220374271.tapHandle(key0)">
											<text class='flex-sub feedBack_fd1_0_c0_c1_c0_c0_c0'>{{item.title}}</text>
										</view>
										<view v-else
											class='flex align-center justify-center flex feedBack_fd1_0_c0_c1_c0_c1'
											:key="key0" @tap="$refs.showSelectPopup1698220374271.tapHandle(key0)">
											<text class='flex-sub feedBack_fd1_0_c0_c1_c0_c1_c0'>{{item.title}}</text>
										</view>
									</template></benben-select-diy>
							</view>
						</view>
						<view class='flex flex-direction flex-wrap align-stretch feedBack_fd1_0_c1'>
							<text class='feedBack_fd1_0_c1_c0'>问题描述</text>
							<view class='flex flex-wrap feedBack_fd1_0_c1_c1'>
								<textarea class='flex feedBack_input_fd1_0_c1_c1' confirm-type="done"
									:placeholder="'问题描述的越详细，有助于我们更快的解决问题'" :maxlength="300" :show-num='true'
									placeholder-style="color:#999;font-size:28rpx;" v-model="body" />
								<template>
									<view class='flex flex justify-end feedBack_numberfd1_0_c1_c1_c0'
										style="font-family: PingFang SC, PingFang SC;">
										<text>{{body.length}}</text>
										<text>/</text>
										<text>300</text>
									</view>
								</template>
							</view>
							<view class='flex flex-direction flex-wrap align-stretch'>
								<benben-images-upload ref="benbenImagesUploadfd1_0_c1_c2_c0" :img-list.sync="img"
									:img-ids.sync="img_id" :is-show-tips='true' :maxlength="6">
									<template #content="{ num, maxlength, isShow, imgList }">
										<view class="flex flex-wrap align-start flex feedBack_fd1_0_c1_c2_c0">

											<view v-for="(image, index) in imgList" :key="index"
												class='flex position-relative feedBack_fd1_0_c1_c2_c00'>
												<text class='fu-iconfont2 position-absolute feedBack_fd1_0_c1_c2_c000'
													@tap.stop="$refs.benbenImagesUploadfd1_0_c1_c2_c0.delImage(index)">&#xE8E7;</text>
												<image class='feedBack_fd1_0_c1_c2_c001'
													@tap.stop="$refs.benbenImagesUploadfd1_0_c1_c2_c0.previewImage(index)"
													mode="aspectFill" :src='image'></image>
											</view>

											<image class='feedBack_fd1_0_c1_c2_c01'
												@tap.stop="$refs.benbenImagesUploadfd1_0_c1_c2_c0.manyChooseImage()"
												v-if="isShow" mode="aspectFill" :src='STATIC_URL+"252.png"'></image>
											<text class='image_upload_tips feedBack_fd1_0_c1_c2_c02'>请上传应用截图，最多上传{{maxlength}}张</text>
										</view>
									</template>
								</benben-images-upload>
							</view>
						</view>
					</view>
					<view class="feedBack_fd1_1">
						<view class="submit_1" @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/xitongs/feedBackDetails/feedBackDetails`">反馈记录</view>
						<button class='submit_2' @tap.stop="postfeedbackFunc()">提交反馈</button>
					</view>
				</view>
			</block>

		
		</view>
		<view style="height: 206rpx;"></view>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"changeId": "1",
				"dataList": [],
				"body": "",
				"img": [],
				"img_id": "",
				"isShow": true,
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.getTypeFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//提交反馈
			async postfeedbackFunc() {
				if (!validate(this.changeId, 'require')) {
					this.$message.info('请选择反馈类型');
					return false;
				}
				if (!this.body.trim()) {
					this.$message.info('请输入问题描述');
					return false;
				}

				this.$api.post(global.API_VERSION + '5cc3f28296cf0', {
					operationsuggestionstype_id: this.changeId,
					body: this.body,
					thumb: this.img.length > 0 ? this.img.join(',') : ""
				}).then(res => {
					this.$message.info(res.data.msg);
					if (res.data.code == 1) {
						setTimeout(() => {
							this.$urouter.redirectTo(`/pages/xitongs/feedBackDetails/feedBackDetails`);
						}, 800)
					}
				})
			},
			//获取反馈类型
			async getTypeFunc() {
				//请求方法
				//数据验证

				let datadataList = await this.$api.post(global.API_VERSION + '63a6b481e9918', {

				});
				this.isShow = false;
				if (datadataList.data.code != 1) {
					this.$message.info(datadataList.data.msg);
					return
				}
				let infodataList = datadataList.data;
				this.dataList = infodataList.data
				this.changeId = this.dataList[0].id //默认类型id
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background-size: 100% auto;
	}

	.feedBack_flex_0 {
		border-bottom: 1px solid #eee;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
		background: #FFFFFF;
	}

	.feedBack_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 200rpx;
	}

	.feedBack_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #000000;
		line-height: 50rpx;
	}

	.feedBack_fd0_0_c0_c0 {
		font-size: 36rpx;
		font-weight: 400;
		color: #333;
	}

	.feedBack_fd0_0_c0 {
		width: 200rpx;
	}

	.feedBack_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.feedBack_flex_1 {
		margin: 0rpx 0rpx 0rpx 0rpx;
	}

	.feedBack_fd1_1 {
		padding: 0 56rpx 40rpx;
		position: fixed;
		left: 0;
		bottom: calc(0rpx + var(--window-bottom));
	}
	.submit_1 {
		text-align: center;
		margin-bottom: 40rpx;
		font-size: 28rpx;
		color: #666;
	}
	.submit_2 {
		height: 88rpx;
		line-height: 88rpx;
		width: 638rpx;
		background: #F35D2A;
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: var(--benbenFontColor3);
	}

	.feedBack_fd1_0_c1_c2_c02 {
		font-size: 24rpx;
		color: var(--benbenFontColor2);
		font-weight: 400;
		width: 100%;
	}

	.feedBack_fd1_0_c1_c2_c01 {
		width: 160rpx;
		height: 160rpx;
		margin: 0rpx 24rpx 24rpx 0rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedBack_fd1_0_c1_c2_c001 {
		width: 160rpx;
		height: 160rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.feedBack_fd1_0_c1_c2_c000 {
		top: 0rpx;
		right: 0rpx;
		z-index: 9;
		color: #ff5536;
	}

	.feedBack_fd1_0_c1_c2_c00 {
		margin: 0rpx 24rpx 24rpx 0rpx;
	}

	.feedBack_fd1_0_c1_c2_c0 {
		padding: 24rpx 0rpx 0rpx 0rpx;
	}

	.feedBack_numberfd1_0_c1_c1_c0 {
		width: 100%;
		font-size: 24rpx;
		color: rgba(153, 153, 153, 1);
		line-height: 46rpx;
		font-weight: 400;
		margin: 0rpx 0rpx 24rpx 0rpx;
	}

	.feedBack_input_fd1_0_c1_c1 {
		width: 594px;
		height: 166rpx;
		font-size: 28rpx;
		font-weight: 400;
		color: var(--benbenFontColor0);
	}

	.feedBack_fd1_0_c1_c1 {
		width: 686rpx;
		border-bottom: 1px solid #eee;
	}

	.feedBack_fd1_0_c1_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #111111;
		margin-bottom: 32rpx;
	}

	.feedBack_fd1_0_c1 {
		background: #FFFFFF;
		padding: 32rpx;
	}

	.feedBack_fd1_0_c0_c1_c0_c1_c0 {
		font-size: 28rpx;
		font-weight: 500;
		color: #666;
		// line-height: 62rpx;
		// -webkit-line-clamp: 1;
		// overflow: hidden;
		// text-overflow: ellipsis;
		// display: -webkit-box;
		// -webkit-box-orient: vertical;
		// text-align: center;
	}

	.feedBack_fd1_0_c0_c1_c0_c1 {
		border: 1px solid #F6F7F9;
		background: #F6F7F9;
		margin: 0rpx 34rpx 24rpx 0rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		padding: 12rpx 48rpx;
	}

	.feedBack_fd1_0_c0_c1_c0_c0_c0 {
		font-size: 28rpx;
		font-weight: 500;
		color: #F35D2A;
		// line-height: 62rpx;
		// -webkit-line-clamp: 1;
		// overflow: hidden;
		// text-overflow: ellipsis;
		// display: -webkit-box;
		// -webkit-box-orient: vertical;
		// text-align: center;
	}

	.feedBack_fd1_0_c0_c1_c0_c0 {
		background: #FFEEE8;
		margin: 0rpx 34rpx 24rpx 0rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 1px solid #F35D2A;
		padding: 12rpx 48rpx;
	}

	.feedBack_fd1_0_c0_c0_c1_c0 {
		font-size: 32rpx;
		font-weight: 400;
		color: #999999;
	}

	.feedBack_fd1_0_c0_c0_c1 {
		margin: 0rpx 0rpx 0rpx auto;
	}

	.feedBack_fd1_0_c0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.feedBack_fd1_0_c0_c0 {
		margin-bottom: 24rpx;
	}

	.feedBack_fd1_0_c0 {
		padding: 32rpx;
		background: #FFFFFF;
		margin-bottom: 20rpx;
	}

	.feedBack_fd1_0 {
		padding: 0rpx 0rpx 48rpx 0rpx;
		margin: 0rpx 0rpx 180rpx 0rpx;
	}
</style>